import Api from "../apis/Apis";
import Http from "../../utils/http";
import Tools from "../../utils/tools";

const list = (queryParams) => {
    const queryString = Tools.paramsToQueryString(queryParams);
    return Http.get(Api.CompanyAccount.list+queryString);
}

const byId = (id) => {
    return Http.get(Api.CompanyAccount.byId+id);
}

const create = (params) => {
    return Http.post(Api.CompanyAccount.create, params);
}

const update = (params) => {
    return Http.post(Api.CompanyAccount.update, params);
}

const freeze = (id) => {
    return Http.post(Api.CompanyAccount.freeze+id);
}

const employees = () => {
    return Http.get(Api.CompanyAccount.employees);

}

const resetPassword = (params) => {
    return Http.post(Api.Account.resetPassword, params);
}

const CompanyAccountService = {
    list,
    byId,
    create,
    update,
    freeze,
    employees,
    resetPassword
}

export default CompanyAccountService;